/**
 * 
 */
package cn.g31010.sip.pojo;

import org.json.JSONObject;

/**
 * @author user
 *
 */
public class Gateway implements java.io.Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7218157884306324814L;
	
	private String id;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	private String mediaserver;
	private String appserver;
	public String getMediaserver() {
		return this.mediaserver;
	}
	public void setMediaserver(String mediaserver) {
		this.mediaserver = mediaserver;
	}
	public String getAppserver() {
		return this.appserver;
	}
	public void setAppserver(String appserver) {
		this.appserver = appserver;
	}
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((this.appserver == null) ? 0 : this.appserver.hashCode());
		result = prime
				* result
				+ ((this.mediaserver == null) ? 0 : this.mediaserver.hashCode());
		return result;
	}
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Gateway other = (Gateway) obj;
		if (this.appserver == null) {
			if (other.appserver != null)
				return false;
		} else if (!this.appserver.equals(other.appserver))
			return false;
		if (this.mediaserver == null) {
			if (other.mediaserver != null)
				return false;
		} else if (!this.mediaserver.equals(other.mediaserver))
			return false;
		return true;
	}
	
	public String toString() {
		JSONObject jso=new JSONObject(this);
		return jso.toString();
	}
	
	public static void main(String args[]){
		Gateway gw = new Gateway();
		gw.id="GW0001";
		gw.appserver="http://appserver.31010.cn/openvchat";
		gw.mediaserver="http://mediaserver.31010.cn/openvchat";
		
		System.out.println(gw);
	}
}
